参数:
-t : 指明显示TCP端口
-u : 指明显示UDP端口
-l : 仅显示监听套接字
-p : 显示进程标识符和程序名称,每一个套接字/端口都属于一个程序。
-n : 不进行DNS轮询,显示IP(可以加速操作)
查看网络监听端口:-lnp参数
[root@localhost dev]# netstat -lnp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 6078/sshd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 6231/master
tcp6 0 0 :::22 :::* LISTEN 6078/sshd
tcp6 0 0 ::1:25 :::* LISTEN 6231/master
udp 0 0 127.0.0.1:323 0.0.0.0:* 5366/chronyd
udp6 0 0 ::1:323 :::*